-
Notifications
You must be signed in to change notification settings - Fork 108
feat: Implement Snippet Lock Feature #323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: core-beta
Are you sure you want to change the base?
feat: Implement Snippet Lock Feature #323
Conversation
|
@imantsk Should I change the branch I make the PRs on, in future PRs? I saw yesterday that after getting merged to core branch, it got reverted. |
|
Hi @mgiannopoulos24 👋 |
|
Okay sure thing. Thanks for letting me know |
src/php/class-db.php
Outdated
| condition_id BIGINT(20) NOT NULL DEFAULT 0, | ||
| priority SMALLINT NOT NULL DEFAULT 10, | ||
| active TINYINT(1) NOT NULL DEFAULT 0, | ||
| locked TINYINT(1) NOT NULL DEFAULT 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it might cause unexpected side-effects to legacy users, we usually try to avoid altering the **_snippets table.
May i suggest you to consider wp_options instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will change it yes.
ccb30cc to
13107e2
Compare
37fc32f to
a501c3c
Compare
|
I'm really sorry for making a mess on the commits. I merged the wrong branch and I had to revert this. |
Description
This PR introduces a "Lock" feature for code snippets. When a snippet is locked, it becomes read-only in the editor and cannot be
trashed or permanently deleted until it is unlocked. This provides an essential safety layer for critical production snippets.
Related issue
Issue #256
Changes
Integrated the toggle into the EditorSidebar.
Screenshots
lockedcolumn:How to Test